package com.ruoyi.common.enums;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 任务状态
 *
 * @author Gua
 * @version 1.0
 * @date 2022-02-22
 */
public enum TaskCode {
    //TODO:完善TaskCode内容
    NOT_START(0, "未开始"),
    EXECUTING(1, "执行中"),
    STOP(4, "执行中止"),
    EXECUTED_FAIL(7, "执行失败"),
    EXECUTED_FINISH(9, "执行完成");

    private final int value;
    private final String description;

    TaskCode(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE)
                .append("value", getValue())
                .append("description", getDescription())
                .toString();
    }
}
